home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / MacHaskell 2.2 / com / akcl / savesys < prev   
Encoding:
Text File  |  1994-09-27  |  1.5 KB  |  48 lines  |  [TEXT/ttxt]

  1. #!/bin/csh
  2. #
  3. # savesys -- build a saved executable in bin/new-cmu-haskell.core
  4. #
  5. #
  6. cd $Y2
  7. setenv PRELUDEBIN $Y2/progs/prelude/akcl
  8. if !(-e $PRELUDEBIN/Prelude.o) then
  9.   echo "Build the prelude first, stupid..."
  10.   exit
  11.   endif
  12. $AKCL <<EOF
  13. ;;; Load the Haskell system.
  14. (make-package "MUMBLE-IMPLEMENTATION" :use '("LISP"))
  15. (load "cl-support/cl-init.lisp")
  16. ;;; Set various internal switches to appropriate values for running
  17. ;;; Haskell code.
  18. (proclaim '(optimize (speed 3) (safety 0) (compilation-speed 0)))
  19. (setf *load-verbose* nil)
  20. (setf compiler:*compile-verbose* nil)
  21. (in-package :mumble-user)
  22. (setf *printers* '(compiling loading prompt))
  23. (setf *compile-interface* '#f)
  24. (setf *code-chunk-size* 100)
  25. ;;; Load the prelude.
  26. (compile/load *prelude-unit-filename*)
  27. ;;; Set up the saved system.
  28. ;;; AKCL doesn't have the new CL condition system, so define the 
  29. ;;; restart function using catch and throw.
  30. (setf *modules-loaded* '())
  31. (define (haskell-toplevel)
  32.   (setf lisp:*package* (lisp:find-package :mumble-user))
  33.   (setf lisp:*default-pathname-defaults* (lisp:truename "./"))
  34.   (use-vanilla-interface)
  35.   (load-init-files)
  36.   (do () ('#f)
  37.     (lisp:catch 'restart-haskell
  38.       (heval))))
  39. (define (restart-haskell)
  40.   (lisp:throw 'restart-haskell '#f))
  41. ;;; Have to do garbage collection and set-up of top-level function
  42. ;;; by hand before calling save.
  43. ;;; AKCL exits automatically after calling save.
  44. (lisp:gbc 3)
  45. (setf system::*top-level-hook* (function haskell-toplevel))
  46. (lisp:save "bin/new-akcl-haskell")
  47. EOF
  48.